﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Scheduledefault.aspx.cs" Inherits="cs499.Schedule.Scheduledefault" %>
<%@ MasterType VirtualPath="~/Site.Master" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content runat="server" ID="navbar" ContentPlaceHolderID="NavOptions">
    <ul>
        <li><asp:LinkButton ID="generateschedulebutton" runat="server" OnClick="generateschedulebutton_Click">Generate Schedule</asp:LinkButton></li>
        <li><asp:LinkButton ID="deleteschedulebutton" runat="server" OnClick="deleteschedulebutton_Click">Delete Schedule</asp:LinkButton></li>
    </ul>
</asp:Content>
<asp:Content runat="server" ID="FeaturedContent" ContentPlaceHolderID="FeaturedContent">
    <section class="featured">
        <div class="content-wrapper">
            <h3>Schedule for <asp:Label ID="DepartmentLabel" runat="server" Text="" /></h3>
        </div>
    </section>
</asp:Content>
<asp:Content runat="server" ID="BodyContent" ContentPlaceHolderID="MainContent">
    <h3>List of Conflicts</h3>
    <asp:GridView ID="ConflictGridView" runat="server" AutoGenerateColumns="False" DataSourceID="ConflictDataSource">
        <Columns>
            <asp:HyperLinkField DataNavigateUrlFields="Id" DataNavigateUrlFormatString="~/Schedule/EditSchedule.aspx?ID={0}" Text="Edit" HeaderText="" />
            <asp:BoundField DataField="Course" HeaderText="Course" SortExpression="Course" />
            <asp:BoundField DataField="SectionNumber" HeaderText="SectionNumber" SortExpression="SectionNumber" />
        </Columns>
    </asp:GridView>
    <asp:ObjectDataSource ID="ConflictDataSource" runat="server" SelectMethod="GetConflictedCourses" TypeName="cs499.Database.Department">
        <SelectParameters>
            <asp:SessionParameter DefaultValue="-1" Name="departmentid" SessionField="CurrentDepartmentId" Type="Int32" />
        </SelectParameters>
    </asp:ObjectDataSource>
    <br /><br />
    <h3>Scheduled Courses</h3>
    <asp:GridView ID="ScheduleGridView" runat="server" AutoGenerateColumns="False" DataSourceID="ScheduleDataSource">
        <Columns>
            <asp:HyperLinkField DataNavigateUrlFields="Id" DataNavigateUrlFormatString="~/Schedule/EditSchedule.aspx?ID={0}" Text="Edit" HeaderText="" />
            <asp:TemplateField>
                <ItemTemplate>
                    <asp:LinkButton ID="UnscheduleButton" runat="server" OnClick="UnscheduleButton_Click">Unschedule</asp:LinkButton>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:BoundField DataField="Course" HeaderText="Course" SortExpression="Course" />
            <asp:BoundField DataField="SectionNumber" HeaderText="SectionNumber" SortExpression="SectionNumber" />
            <asp:BoundField DataField="Room" HeaderText="Room" SortExpression="Room" />
            <asp:BoundField DataField="TimeSlot" HeaderText="TimeSlot" SortExpression="TimeSlot" />
            <asp:BoundField DataField="TaughtBy" HeaderText="TaughtBy" SortExpression="TaughtBy" />
        </Columns>
    </asp:GridView>
    <asp:ObjectDataSource ID="ScheduleDataSource" runat="server" SelectMethod="GetScheduledCourses" TypeName="cs499.Database.Department">
        <SelectParameters>
            <asp:SessionParameter DefaultValue="-1" Name="departmentid" SessionField="CurrentDepartmentId" Type="Int32" />
            <asp:Parameter DefaultValue="-1" Name="placeid" Type="Int32" />
            <asp:Parameter DefaultValue="-1" Name="facultyid" Type="Int32" />
        </SelectParameters>
    </asp:ObjectDataSource>
</asp:Content>
